//
//  WWDViewController.h
//  MyBleTest2
//
//  Created by maginawin on 14-8-11.
//  Copyright (c) 2014年 mycj.wwd. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreBluetooth/CoreBluetooth.h>

@interface ViewController : UIViewController<CBCentralManagerDelegate, CBPeripheralDelegate, UITableViewDataSource, UITableViewDelegate>
/*!
 *中央设备管理器
 */
@property (strong, nonatomic) CBCentralManager* myCentralManager;

/*!
 *外围设备数组
 */
@property (strong, nonatomic) NSMutableArray* myPeripherals;

/*!
 *外围设备
 */
@property (strong, nonatomic) CBPeripheral* myPeripheral;

/*!
 *服务数组
 */
@property (strong, nonatomic) NSMutableArray* nServices;

/*!
 *设备数组
 */
@property (strong, nonatomic) NSMutableArray* nDevices;

/*!
 *特征值数组
 */
@property (strong, nonatomic) NSMutableArray* nCharacteristics;

/*!
 *write特征值
 */
@property (strong, nonatomic) CBCharacteristic* writeCharacteristic;

/*!
 *read特征值
 */
@property (strong, nonatomic) CBCharacteristic* readCharacteristic;
@property (nonatomic) BOOL isConnected;

@property (strong, nonatomic) IBOutlet UITableView *tableView;

- (void)scanClick;
- (void)connectClick;
- (void)disconnect;
- (IBAction)connDevice:(id)sender;

- (void)turnOn;
- (void)turnOff;
- (void)level_1;
- (void)level_2;
- (void)level_3;
- (void)color_1;
- (void)color_2;
- (void)color_3;
- (void)color_4;
- (void)model_1;
- (void)model_2;
- (void)model_3;
- (void)model_4;

- (IBAction)exitHere:(UIStoryboardSegue *)sender;
@end
